﻿using System.Collections.Generic;
using System.Drawing;
using System.Runtime.Serialization;
using System;

namespace MediaController.Server.Core.DataContracts
{
    [DataContract(Name = "SpecialFolderContract")]
    public class SpecialFolderContract : DirectoryContract
    {
        public string DisplayName { get; set; }

        public Environment.SpecialFolder SpecialFolder { get; set; }

        public SpecialFolderContract(Environment.SpecialFolder specialFolder, string displayName)
            : base(string.Empty)
        {
            DisplayName = displayName;
            SpecialFolder = specialFolder;

            LaodSpecialFolderTree();
        }

        private void LaodSpecialFolderTree()
        {
            switch (SpecialFolder)
            {
                case Environment.SpecialFolder.Desktop:
                    break;

                case Environment.SpecialFolder.MyComputer:
                    InitLogicalDrives();
                    break;

                case Environment.SpecialFolder.DesktopDirectory:
                    break;

                case Environment.SpecialFolder.ProgramFiles:
                    break;

            }
        }

        private static void InitLogicalDrives()
        {
            List<DirectoryContract> directoryContracts = new List<DirectoryContract>();
            var logicalDrives = Environment.GetLogicalDrives();
            foreach (var logicalDrive in logicalDrives)
            {
                directoryContracts.Add(new DirectoryContract(logicalDrive));
            }
        }
    }
}
